//
//  NetworkMgr.h
//  ProfilePicture
//
//  Created by 张云江 on 2019/10/14.
//  Copyright © 2019年 张云江. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface NetworkMgr : NSObject

+ (id)shareInstance;

- (void)uploadImage:(NSData *)data
            withApi:(NSString *)api
     withParameters:(NSDictionary *)parameters
            success:(nullable void (^)(NSDictionary *result, int code))success
            failure:(nullable void (^)(NSError *error))failure;

- (void)uploadImage:(NSData *)data
            withApi:(NSString *)api
     withParameters:(NSDictionary *)parameters
            success:(nullable void (^)(NSDictionary *result, int code))success
            failure:(nullable void (^)(NSError *error))failure
         withAppkey:(NSString *)appkey;

- (void)postwithApi:(NSString *)api
     withParameters:(NSDictionary *)parameters
            success:(nullable void (^)(NSDictionary *result, int code))success
            failure:(nullable void (^)(NSError *error))failure;

- (void)postwithImageName:(NSString *)imageName
                  success:(nullable void (^)(NSData *data))success
                  failure:(nullable void (^)(NSError *error))failure;

- (void)postwithApi:(NSString *)api
     withParameters:(NSDictionary *)parameters
            success:(nullable void (^)(NSDictionary *result, int code))success
            failure:(nullable void (^)(NSError *error))failure
         withAppkey:(NSString *)appkey;
@end

NS_ASSUME_NONNULL_END
